
@model List<zhangmenren.Models.EnterpriseEntity>

<div class="bg-white">

    <header class="mui-bar mui-bar-nav head-bar-nav">
        <h1 class="mui-title">企业名录</h1>
        <a class="mui-icon mui-icon-more mui-pull-right" onclick="jsBridge.share()"></a>
    </header>
    <!--DOM	-->
    <div class="mui-content bg-white">
        <!-- Swiper -->
        <div class="swiper-container index-banner-swiper">
            <div class="swiper-wrapper">


                @if (ViewBag.Banner != null && (ViewBag.Banner as List<BannerEntity>)?.Count > 0)
                {
                    foreach (var item in ViewBag.Banner as List<BannerEntity>)
                    {
                        <div class="swiper-slide">
                            <img class="swiper-lazy" data-src="@item.ImgUrl" />
                        </div>
                    }
                }
                else
                {

                    <div class="swiper-slide">
                        <img class="swiper-lazy" data-src="/images/index-banner-img1.jpg" alt="" />
                    </div>
                }
            </div>
            <div class="swiper-pagination"></div>
        </div>
        <!---->
        <div class="search-item-box qyml-search-box">
            <a class="search-head link-href" href='@Url.Action("Join")'>
                加入
            </a>
			@*<a href="@Url.Action("Join")">加入</a>*@
            <div class="search-body">
                <input type="text" placeholder="请输入搜索内容" class="j-souoval" />
            </div>
			<a href="javascript:;" class="j-souo">搜索</a>
        </div>
        <!---->
        <h2 class="header-title-item" style="margin: 10px 15px 0; ">
            企业名录
        </h2>
        <ul class="mui-table-view watch-record-list tutorial-information-list qyml-list">


            @foreach (var item in Model)
            {
                <li class="mui-table-view-cell mui-media">
                    <a class="mui-navigate-right" href="@Url.Action("Detail","QiYe",new {id=item.Id })">
                        <div class="mui-media-object mui-pull-left">
                            <img src="@item.Ico">
                        </div>
                        <div class="mui-media-body">
                            <h5>@item.Name</h5>
                            <p>浏览量：@item.BrowseNum&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;收藏：@item.HouseNum</p>
                        </div>
                    </a>
                </li>
            }

            @*<li class="mui-table-view-cell mui-media">
                    <a class="mui-navigate-right" href="qyml-detail.html">
                        <div class="mui-media-object mui-pull-left">
                            <img src="/images/qyml-list-img2.png">
                        </div>
                        <div class="mui-media-body">
                            <h5>网易科技有限公司</h5>
                            <p>浏览量：100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;收藏：23 </p>
                        </div>
                    </a>
                </li>*@
        </ul>
    </div>
    @{
        await Html.RenderPartialAsync("_Menu", 3);
    }
</div>

@section Scripts{
    <script type="text/javascript" charset="utf-8">
        //
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 3,
            speed: 700,
            spaceBetween: 0,
            slidesPerView: 'auto',
            centeredSlides: true,
            loop: true,
            pagination: {
                el: '.swiper-pagination',
                clickable: true,
            },
            //          autoplay: {
            //              delay: 3000,
            //              stopOnLastSlide: false,
            //              disableOnInteraction: false,
            //          },
            lazy: {
                loadPrevNext: true,
                loadOnTransitionStart: false,
                loadPrevNextAmount: 1,
            },
        });

        swiper.lazy.load();
		$(".j-souo").click(function () {
			$.ajax({
				type:'post',
				url:'@Url.Action("Search")',
				data:{key:$.trim($('.j-souoval').val())},
				success:function(result){
					if (result.state=="ok") {
						console.log(result)
						var htmls='';
						if (result.data.length>0) {
							for (let i = 0; i < result.data.length; i++) {
								htmls+='<li class="mui-table-view-cell mui-media"><a class="mui-navigate-right" href="/QiYe/Detail?id='+result.data[i].id+'"><div class="mui-media-object mui-pull-left"><img src="'+result.data[i].ico+'"></div><div class="mui-media-body"><h5>'+result.data[i].name+'</h5><p>浏览量：'+result.data[i].browseNum+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;收藏：'+result.data[i].houseNum+'</p></div></a></li>';
							}
						}else{
							htmls="<span>暂无数据</span>"
						}
						

						$('.qyml-list').html(htmls);
					}
					
				}
			})
		})		
    </script>
}


